--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<KeyListEntries schema="org.gnome.shell.keybindings"
+ group="system"
+ name="Screenshots"
+ wm_name="GNOME Shell"
+ package="gnome-shell">
+
+ <KeyListEntry name="show-screenshot-ui"
+ description="Take a screenshot interactively"/>
+
+ <KeyListEntry name="screenshot"
+ description="Take a screenshot"/>
+
+ <KeyListEntry name="screenshot-window"
+ description="Take a screenshot of a window"/>
+
+</KeyListEntries>
\ No newline at end of file
keybinding_files = [
'50-gnome-shell-launchers.xml',
+ '50-gnome-shell-screenshots.xml',
'50-gnome-shell-system.xml',
]
</key>
<key name="show-screenshot-ui" type="as">
<default>["Print"]</default>
- <summary>Show screenshot UI</summary>
+ <summary>Take a screenshot interactively</summary>
+ </key>
+ <key name="screenshot-window" type="as">
+ <default>["<Alt>Print"]</default>
+ <summary>Take a screenshot of a window</summary>
+ </key>
+ <key name="screenshot" type="as">
+ <default>["<Shift>Print"]</default>
+ <summary>Take a screenshot</summary>
</key>
</schema>
uiModes,
showScreenshotUI
);
+
+ Main.wm.addKeybinding(
+ 'screenshot-window',
+ new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW,
+ uiModes,
+ async (_display, window, _binding) => {
+ try {
+ const actor = window.get_compositor_private();
+ const content = actor.paint_to_content(null);
+ const texture = content.get_texture();
+
+ await captureScreenshot(texture, null, 1, null);
+ } catch (e) {
+ logError(e, 'Error capturing screenshot');
+ }
+ }
+ );
+
+ Main.wm.addKeybinding(
+ 'screenshot',
+ new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
+ uiModes,
+ async () => {
+ try {
+ const shooter = new Shell.Screenshot();
+ const [content] = await shooter.to_content();
+ const texture = content.get_texture();
+
+ await captureScreenshot(texture, null, 1, null);
+ } catch (e) {
+ logError(e, 'Error capturing screenshot');
+ }
+ }
+ );
}
_refreshButtonLayout() {
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
data/50-gnome-shell-launchers.xml
+data/50-gnome-shell-screenshots.xml
data/50-gnome-shell-system.xml
data/org.gnome.Shell.desktop.in.in
data/org.gnome.shell.gschema.xml.in